<html>
<head>
	<script type="text/javascript">
		var aJaxURL	= "server-side/report/profit.action.php";		//server side folder url
		var tName	= "report";												//table name
		
		$(document).ready(function () {        	
			LoadTable(0, 0);
			GetDate("search_start");
			GetDate("search_end");
		});
        
		function LoadTable(start, end){
			var total = [6,7,8,9,10,11];
			/* Table ID, aJaxURL, Action, Colum Number, Custom Request, Hidden Colum, Menu Array */
			GetDataTable(tName, aJaxURL, "get_list", 12, "start=" + start + "&end=" + end, 0, "", 1, "desc", total);
			$("#search_date").css("width", "90%");
			$("#search_barcode").css("width", "90%");
			$("#search_self_quantity").css("width", "90%");
			$("#search_ert").css("width", "90%");
			$("#search_without_vat").css("width", "90%");						
			$("#search_self_cost").css("width", "90%");
			$("#search_d_profit").css("width", "90%");
			$("#search_sum_without_vat").css("width", "90%");						
			$("#search_sum_self_cost").css("width", "90%");
			$("#search_sum_d_profit").css("width", "90%");
			
			
		}
		
	    $(document).on("change", "#search_start", function () {
	    	var start	= $(this).val();
	    	var end		= $("#search_end").val();
	    	LoadTable(start, end);
	    });
	    
	    $(document).on("change", "#search_end", function () {
	    	var start	= $("#search_start").val();
	    	var end		= $(this).val();
	    	LoadTable(start, end);
	    });
    </script>
</head>

<body>    
    <div id="dt_example" class="ex_highlight_row">
        <div id="container" style="width: 99%">
            <div id="dynamic">
            	<h2 align="center">მოგება</h2>
            	<div id="button_area">
	            	<div class="left" style="width: 250px;">
	            		<input type="text" name="search_start" id="search_start" class="inpt left"/>
	            		<label for="search_start" class="">–დან</label>	            		
	            	</div>
	            	<div class="right" style="width: 250px;">
	            		<input type="text" name="search_end" id="search_end" class="inpt left" />
	            		<label for="search_end" class=" ">–ჩათვლით</label>	            		
            		</div>
            	</div>
                <table class="display" id="report">
                    <thead>
                        <tr id="datatable_header">
                            <th>ID</th>
                            <th style="width: 150px;">თარიღი</th>   
                            <th style="width: 130px;">შტრიხკოდი</th>                                                                           
                            <th style="width: 100%;">დასახელება</th>
                            <th style="width: 81px; padding: 0px 0px 0px 0px; font-size: 8pt !important;"><pre>ზომის
ერთეული</pre></th>                            
                            <th style="width: 55px; padding: 0px 0px 0px 0px; font-size: 8pt !important;">რ – ბა</th>

                            
                            <th style="width: 110px; padding: 0px 0px 0px 0px; font-size: 8pt !important;"><pre>რეალიზაც.
დღგს
გარეშე</pre></th> 
                            <th style="width: 110px; padding: 0px 0px 0px 0px; font-size: 8pt !important;"><pre>თვით.
ღირ–ბა</pre></th> 
                            <th style="width: 110px; padding: 0px 0px 0px 0px; font-size: 8pt !important;"><pre>დ.
მოგება</pre></th>

                            <th style="width: 110px; padding: 0px 0px 0px 0px; font-size: 8pt !important;"><pre>სულ
რეალიზაც.
დღგს
გარეშე</pre></th> 
                            <th style="width: 110px; padding: 0px 0px 0px 0px; font-size: 8pt !important;"><pre>სულ
 თვით.
ღირ–ბა</pre></th> 
                            <th style="width: 110px; padding: 0px 0px 0px 0px; font-size: 8pt !important;"><pre>სულ დ.
მოგება</pre></th>                           
                        </tr>
                    </thead>
                    <thead>
                        <tr class="search_header">
                            <th class="colum_hidden">
                            	<input type="text" name="search_id" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" id="search_date" name="search_date" value="ფილტრი" class="search_init" />
                            </th>                            
                            <th>
                                <input type="text" id="search_barcode" name="search_barcode" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" id="search_name" name="search_name" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" id="search_ert" name="search_ert" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" id="search_self_quantity" name="search_self_quantity" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" id="search_without_vat" name="search_without_vat" value="ფილტრი" class="search_init" />
                            </th>                            
                            <th>
                                <input type="text" id="search_self_cost" name="search_self_cost" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" id="search_d_profit" name="search_d_profit" value="ფილტრი" class="search_init" />
                            </th>                                                        
                            <th>
                                <input type="text" id="search_sum_without_vat" name="search_sum_without_vat" value="ფილტრი" class="search_init" />
                            </th>                   
                            <th>
                                <input type="text" id="search_sum_self_cost" name="search_sum_self_cost" value="ფილტრი" class="search_init" />
                            </th> 
                            <th>
                                <input type="text" id="search_sum_d_profit" name="search_sum_d_profit" value="ფილტრი" class="search_init" />
                            </th>                                                       
                        </tr>
                    </thead>                       
                    <tfoot>
                        <tr>
                            <th>&nbsp;</th>
                            <th>&nbsp;</th>
                            <th>&nbsp;</th>  
                            <th>&nbsp;</th>
                            <th>&nbsp;</th>                         
                            <th style="padding: 0px 0px 0px 0px;"><p align="right">ჯამი:<br/>სულ ჯამი:</th>
							<th style="padding: 0px 0px 0px 0px;">&nbsp;</th>   
                            <th style="padding: 0px 0px 0px 0px;">&nbsp;</th>
                            <th style="padding: 0px 0px 0px 0px;">&nbsp;</th>
                            <th style="padding: 0px 0px 0px 0px;">&nbsp;</th>  
                            <th style="padding: 0px 0px 0px 0px;">&nbsp;</th>
                            <th style="padding: 0px 0px 0px 0px;">&nbsp;</th>                                                      
                        </tr>
                    </tfoot>
                </table>
            </div>
            <div class="spacer">
            </div>
        </div>
    </div>
</body>
</html>